home *** CD-ROM | disk | FTP | other *** search
/ GameStar 1998 November (Bonus) / GAMESTAR11B.ISO / ENCYC99 / MM / T620273A.DCR / scripts_22_Class InfoBox.ls < prev    next >
Encoding:
Text File  |  1998-07-02  |  1.3 KB  |  58 lines

  1. property eventLists, titleField, titleFieldName, ScrollBar, savedTitle
  2.  
  3. on catchEvent me, xEventNum
  4.   set thisEventList to getAt(eventLists, xEventNum)
  5.   changeTitle(me, getProp(thisEventList, #title))
  6.   changeCopy(me, getProp(thisEventList, #copy))
  7. end
  8.  
  9. on stringEvent me, xString
  10.   changeTitle(me, xString)
  11.   set copyMember to member (xString && "copy")
  12.   changeCopy(me, copyMember)
  13. end
  14.  
  15. on new me, xTitleField, xScrollBar
  16.   set eventLists to []
  17.   set titleField to xTitleField
  18.   set titleFieldName to the name of titleField
  19.   set ScrollBar to xScrollBar
  20.   set savedTitle to the text of titleField
  21.   return me
  22. end
  23.  
  24. on addThing me, xThing
  25.   set thisTitle to string(getType(xThing))
  26.   set copyName to thisTitle && "copy"
  27.   set thisCopy to member copyName
  28.   case thisTitle of
  29.     "Guanine":
  30.       set thisTitle to "Guanin"
  31.     "Cytosine":
  32.       set thisTitle to "Cytosin"
  33.     "Thymine":
  34.       set thisTitle to "Thymin"
  35.     "DNA and Mutations":
  36.       set thisTitle to "DNA und Mutationen"
  37.     "Adenine":
  38.       set thisTitle to "Adenin"
  39.     otherwise:
  40.       nothing()
  41.   end case
  42.   add(eventLists, [#title: thisTitle, #copy: thisCopy])
  43.   return count(eventLists)
  44. end
  45.  
  46. on cleanUp me
  47.   changeTitle(me, savedTitle)
  48.   cleanUp(ScrollBar)
  49. end
  50.  
  51. on changeTitle me, xString
  52.   set the text of titleField to xString
  53. end
  54.  
  55. on changeCopy me, xMember
  56.   newMember(ScrollBar, xMember)
  57. end
  58.